#ifndef __GRAPHICS2D_H__
#define __GRAPHICS2D_H__

#ifdef __GRAPHICS2D_CPP__
#define G2DAPI
#else 
#define G2DAPI extern
#endif
#include "Color.h"

G2DAPI void G2dInit(int width = 800, int height = 600, const char *title = "Graphics2d", bool resizeable = false);
G2DAPI void G2dWaitClose();
G2DAPI void G2dClose();
G2DAPI bool G2dWindowShouldClose();

G2DAPI void G2dSetBackgroundColor(float r, float g, float b, float a);
G2DAPI void G2dClearColor();
G2DAPI void G2dSwapFrame();

struct G2dPoint
{
    double x, y;
};
enum G2dMKState
{
    Press = 1,
    Relase = 0
};
enum G2dMouseButton
{
    MouseLeft = 0,
    MouseMiddle = 2,
    MouseRight = 1
};
G2DAPI G2dPoint G2dGetMousePos();
G2DAPI G2dPoint G2dGetWindowSize();
G2DAPI G2dMKState G2dGetMouseState(G2dMouseButton bt);

typedef int G2dImage;
G2DAPI G2dImage G2dLoadImage(const char *filename);
G2DAPI void G2dPutImage(G2dImage img, float x, float y, float w, float h, float r = 0.0f, RGBA color = RGBA(1.0f, 1.0f, 1.0f, 1.0f));

#endif